﻿//Class designed to retrieve the value from the OCR combo box.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OCRGUI2008
{
    class CmbSelection
    {

       
        public CmbSelection()
        {
            
        }
       
        public int getValue(string _name) //_name is the name of the OCR option
        {

            int thevalue = 2; // Variable to be returned by the function
          
            if (string.Compare(_name,"0.) Digits") == 0)
            {
                thevalue = 0;
            }
            else if(string.Compare(_name,"1.) Digits with Decimal") == 0)
            {
                thevalue = 1;
            }
            else if(string.Compare(_name,"2.) English") == 0)     
            {
                thevalue = 2;
            }
            else if (string.Compare(_name, "3.) Subset Chinese Only") == 0)
            {
                thevalue = 3;
            }
            else if(string.Compare(_name,"4.) 1D-Barcode") == 0)
            {
                thevalue = 4;
            }
            else if (string.Compare(_name, "6.) Chinese All") == 0)
            {
                thevalue = 6;
            }
            else
            {
                thevalue = 2;
            }



            return thevalue; //Returns a int containing the selection value
        }

        
    }
    
}
